# -*- coding: utf-8 -*-
from django.conf.urls.defaults import *
from django.contrib.auth.decorators import login_required
from repairs.views import add_worker, exportexcel, RmonthList, RthismonthListList, RepairCreateView, RepairUpdateView, RepairDeleteView, exportexcel_root

urlpatterns = patterns('',
    url(r'^add/(?P<r_id>\d+)/(?P<u_id>\d+)/$', login_required(add_worker), name="repairs_add"),
    url(r'^list/$', login_required(RthismonthListList.as_view()), name="repairs_start"),
    url(r'^delete/(?P<pk>[-\w]+)/$', login_required(RepairDeleteView.as_view()), name="repairs_delete"),
    url(r'^create/$', login_required(RepairCreateView.as_view()), name="repairs_create"),
    url(r'^update/(?P<pk>[-\w]+)/$', login_required(RepairUpdateView.as_view()), name="repairs_update"),
    url(r'^report/(?P<repair>\d+)/$', login_required(exportexcel), name="export_by_repair"),
    url(r'^report_r/(?P<repair>\d+)/$', login_required(exportexcel_root), name="export_by_repair_root"),
    url(r'^(?P<year>\d+)/(?P<month>\d+)/$', RmonthList.as_view(), name="repairs_month"),
)